#ifndef __BME280_APPLICATION_H__
#define __BME280_APPLICATION_H__

#ifdef __cplusplus
extern "C"{
#endif

//#include "stm32f4xx_hal.h"
//#include "usart.h"

#include "bme280.h"
#include "bme280_selftest.h"

#define BME280_USING_HARDWARE_I2C 1 //使用硬件i2c
#define BME280_USING_SOFTWARE_I2C 0 //使用软件i2c(需初始化软件i2c)

#if BME280_USING_HARDWARE_I2C
#include "i2c.h"
#define I2Cx hi2c2
#endif
#if BME280_USING_SOFTWARE_I2C
#include "software_i2c.h"
#endif

extern struct bme280_data comp_data;
extern struct bme280_dev dev;
//void BME280_INIT(void);
int8_t stream_sensor_data_normal_mode(struct bme280_dev *dev);
int8_t stream_sensor_data_forced_mode(struct bme280_dev *dev);

void user_delay_ms(uint32_t period);
int8_t user_i2c_read(uint8_t dev_id, uint8_t reg_addr, uint8_t *reg_data, uint16_t len);
int8_t user_i2c_write(uint8_t dev_id, uint8_t reg_addr, uint8_t *reg_data, uint16_t len);

#ifdef __cplusplus
}
#endif

#endif //__BME280_APPLICATION_H__
